package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.cnswhy.cloud.server.common.entity.enumeration.SmsType;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-27
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_sms_tempate")
@ApiModel(value = "SmsTempate", description = "")
@AllArgsConstructor
public class SmsTempate extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 短信类型 #SmsType{SMS_CODE:验证码;SPELL_SUCCESS:拼团成功;}
     */
    @ApiModelProperty(value = "短信类型 #SmsType{SMS_CODE:验证码;SPELL_SUCCESS:拼团成功;}")
    @TableField("type")
    @Excel(name = "短信类型 #SmsType{SMS_CODE:验证码;SPELL_SUCCESS:拼团成功;}", replace = {"验证码_SMS_CODE", "拼团成功_SPELL_SUCCESS",  "_null"})
    private SmsType type;

    /**
     * accessKeyId
     */
    @ApiModelProperty(value = "accessKeyId")
    @Length(max = 64, message = "accessKeyId长度不能超过64")
    @TableField(value = "access_key_id", condition = LIKE)
    @Excel(name = "accessKeyId")
    private String accessKeyId;

    /**
     * accessSecret
     */
    @ApiModelProperty(value = "accessSecret")
    @Length(max = 64, message = "accessSecret长度不能超过64")
    @TableField(value = "access_secret", condition = LIKE)
    @Excel(name = "accessSecret")
    private String accessSecret;

    /**
     * 签名
     */
    @ApiModelProperty(value = "签名")
    @Length(max = 64, message = "签名长度不能超过64")
    @TableField(value = "sign_name", condition = LIKE)
    @Excel(name = "签名")
    private String signName;

    /**
     * 模板ID
     */
    @ApiModelProperty(value = "模板ID")
    @Length(max = 64, message = "模板ID长度不能超过64")
    @TableField(value = "template_code", condition = LIKE)
    @Excel(name = "模板ID")
    private String templateCode;


    @Builder
    public SmsTempate(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    SmsType type, String accessKeyId, String accessSecret, String signName, String templateCode) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.type = type;
        this.accessKeyId = accessKeyId;
        this.accessSecret = accessSecret;
        this.signName = signName;
        this.templateCode = templateCode;
    }

}
